package com.ybg.demo.consul.consumer.controller;

import com.ybg.demo.consul.consumer.feign.UserFeign;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping(value = "/user")
public class UserController {

    private final UserFeign userFeign;

    public UserController(UserFeign userFeign) {
        this.userFeign = userFeign;
    }

    @PostMapping(value = "/login")
    public Map<String, Object> login(String loginName, String password) {
        return userFeign.login(loginName, password);
    }

}
